/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.web.misc.license;

public abstract class Products {
    public static final int UNKNOW = -1;
    public static final int IDEA_ID = 1;
    public static final int RUBYMINE_ID = 4;
    public static final int PYCHART_ID = 5;
    public static final int WEBSTORM_ID = 6;
    public static final int PHPSTORM_ID = 7;
    public static final int APPCODE_ID = 8;
    private static final String IDEA = "IDEA";
    private static final String RUBYMINE = "RUBYMINE";
    private static final String PYCHARM = "PYCHARM";
    private static final String WEBSTORM = "WEBSTORM";
    private static final String PHPSTORM = "PHPSTORM";
    private static final String APPCODE = "APPCODE";


    public static String getProductName(int paramInt) {
        switch (paramInt) {
            case IDEA_ID:
                return IDEA;
            case RUBYMINE_ID:
                return RUBYMINE;
            case PYCHART_ID:
                return PYCHARM;
            case WEBSTORM_ID:
                return WEBSTORM;
            case PHPSTORM_ID:
                return PHPSTORM;
            case APPCODE_ID:
                return APPCODE;
        }
        throw new IllegalArgumentException("Unknown product:" + paramInt);
    }

    public static int getProductId(String product) {
        if (IDEA.equals(product)) {
            return IDEA_ID;
        }
        if (RUBYMINE.equals(product)) {
            return RUBYMINE_ID;
        }
        if (PYCHARM.equals(product)) {
            return PYCHART_ID;
        }
        if (WEBSTORM.equals(product)) {
            return WEBSTORM_ID;
        }
        if (PHPSTORM.equals(product)) {
            return PHPSTORM_ID;
        }
        if (APPCODE.equals(product)) {
            return APPCODE_ID;
        }
        throw new IllegalArgumentException("Unknown product:" + product);
    }

    private Products() {
    }
}